package com.edu.fjnu.eshop.service;

import com.edu.fjnu.eshop.dao.UserMapper;
import com.edu.fjnu.eshop.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    public List<User> getAll() {
        return userMapper.getAll();
    }

    public void save(User user) {
        userMapper.save(user);
    }

    public void delete(int userId) {
        userMapper.delete(userId);
    }

    public void update(User user) {
        userMapper.update(user);
    }

    public User getUserById(int userId) {
        return userMapper.getUserById(userId);
    }

	public void updatePwd(String password, int userId) {
		userMapper.updatePwd(password, userId);
	}
}
